CLASS lhc_ymoon_i_api012 DEFINITION INHERITING FROM cl_abap_behavior_handler.
  PRIVATE SECTION.

    METHODS get_instance_authorizations FOR INSTANCE AUTHORIZATION
      IMPORTING keys REQUEST requested_authorizations FOR ymoon_i_api012 RESULT result.
    METHODS create_api FOR MODIFY
      IMPORTING keys FOR ACTION ymoon_i_api012~create_api.
*
*    METHODS create FOR MODIFY
*      IMPORTING entities FOR CREATE ymoon_i_api012.
*
*    METHODS update FOR MODIFY
*      IMPORTING entities FOR UPDATE ymoon_i_api012.
*
*    METHODS delete FOR MODIFY
*      IMPORTING keys FOR DELETE ymoon_i_api012.
*
*    METHODS read FOR READ
*      IMPORTING keys FOR READ ymoon_i_api012 RESULT result.
*
*    METHODS lock FOR LOCK
*      IMPORTING keys FOR LOCK ymoon_i_api012.
*    METHODS create_api FOR MODIFY
*      IMPORTING keys FOR ACTION ymoon_i_api012~create_api.
*
*
*    METHODS call_out_api EXPORTING out_tab TYPE ymoonst_api012.

ENDCLASS.

CLASS lhc_ymoon_i_api012 IMPLEMENTATION.

  METHOD get_instance_authorizations.
  ENDMETHOD.

*  METHOD create.
*    DATA:lt_table TYPE ymoonst_api012.
*    DATA:lt_api012 TYPE TABLE OF ymoont_api012,
*         ls_api012 TYPE ymoont_api012.
*
*    DATA:lt_crt TYPE TABLE FOR CREATE ymoon_i_api012,
*         ls_crt LIKE LINE OF lt_crt.
*
*    call_out_api( IMPORTING out_tab = lt_table ).
*
*    DATA(ls_entity) = entities[ 1 ].
*
*    DATA(lo_system_uuid) = NEW cl_system_uuid( ).
*
*    LOOP AT lt_table INTO DATA(ls_table).
*
*      CHECK sy-tabix = 1.
*      MOVE-CORRESPONDING ls_table TO ls_crt.
*
*      TRY.
*          ls_crt-uuid = lo_system_uuid->if_system_uuid~create_uuid_x16( ).
*        CATCH cx_uuid_error.
*      ENDTRY.
**      ls_crt-uuid
*      ls_crt-regid = sy-uname.
*      ls_crt-regdate = sy-datum.
*
*      ls_crt-%cid = ls_entity-%cid.
*
*      ls_crt-%control-uuid = '01'.
*      ls_crt-%control-regid = '01'.
*      ls_crt-%control-regdate = '01'.
*      ls_crt-%control-cntysgn = '01'.
*      ls_crt-%control-mtryutlnm = '01'.
*      ls_crt-%control-fxrt = '01'.
*      ls_crt-%control-currsgn = '01'.
*      ls_crt-%control-aplybgndt = '01'.
*      ls_crt-%control-imextp = '01'.
*
*      APPEND ls_crt TO lt_crt.
*
*
*      MOVE-CORRESPONDING ls_crt TO ls_api012.
*      APPEND ls_api012 TO lt_api012.
*
*
*    ENDLOOP.
*    CLEAR lt_api012[].
*    lt_api012 = VALUE #( ( uuid = lo_system_uuid->if_system_uuid~create_uuid_x16( ) reg_id = 'a' ) ).
*    MODIFY ymoon_api012d FROM TABLE @lt_api012.
*
**    insert ymoont_api012 from table @lt_api012.
*
*    " CBO 데이터 업데이트
*
*
**    MODIFY ENTITIES OF ymoon_i_api012 IN LOCAL MODE
**           ENTITY ymoon_i_api012 CREATE FROM lt_crt
**           " TODO: variable is assigned but never used (ABAP cleaner)
**           MAPPED   DATA(ls_mapped_modify)
**           " TODO: variable is assigned but never used (ABAP cleaner)
**           FAILED   DATA(lt_failed_modify)
**           " TODO: variable is assigned but never used (ABAP cleaner)
**           REPORTED DATA(lt_reported_modify).
*
*
*  ENDMETHOD.
*
*  METHOD update.
*  ENDMETHOD.
*
*  METHOD delete.
*  ENDMETHOD.
*
*  METHOD read.
*  ENDMETHOD.
*
*  METHOD lock.
*  ENDMETHOD.
*
*
*  METHOD call_out_api.
*    DATA:http_client TYPE REF TO ymoon_api.
*    CREATE OBJECT http_client
*      EXPORTING
*        i_scenario     = 'YMOON_CS_API012'
*        i_service      = 'YMOON_OS_API012_REST'
*      EXCEPTIONS
*        no_arrangement = 1.
*    IF sy-subrc = 1.
*      "out->write( 'no arrangement' ).
*    ENDIF.
*    CHECK sy-subrc <> 1.
*
*    DATA param TYPE string.
*    DATA res TYPE string.
*    param = 'crkyCn=u270f148l018m219a020m040c0&qryYymmDd=20150101&imexTp=2'.
*
*    res = http_client->get( param ).
*
*
*    DATA: lv_xstring TYPE xstring.
*    DATA: lv_conv TYPE REF TO cl_abap_conv_codepage.
*    lv_xstring = cl_abap_conv_codepage=>create_out( codepage = `UTF-8` )->convert( source = res ).
*    "out->write( lv_xstring ).
*
*    DATA:BEGIN OF ls_data,
*           cntysgn   TYPE c  LENGTH 2,
*           mtryutnm  TYPE c  LENGTH 30,
*           fxrt      TYPE c  LENGTH 13,
*           currsgn   TYPE c  LENGTH 3,
*           aplybgndt TYPE c  LENGTH 8,
*           imextp    TYPE c  LENGTH 1,
*         END OF ls_data.
*    DATA:lt_data LIKE TABLE OF ls_data.
*
*    DATA:gv_cond TYPE c LENGTH 50 VALUE 'trifFxrtInfoQryRsltVo'.
*    DATA:gv_field TYPE c LENGTH 20.
*    FIELD-SYMBOLS <fs> TYPE any.
*
*
*    DATA: lv_reader          TYPE REF TO if_sxml_reader.
*    DATA: lv_node            TYPE REF TO if_sxml_node.
*    DATA: lv_open_node       TYPE REF TO if_sxml_open_element.
*    DATA: lv_close_node      TYPE REF TO if_sxml_close_element.
*    DATA: lv_value_node      TYPE REF TO if_sxml_value.
*    DATA: lv_value           TYPE string.
*
*    lv_reader = cl_sxml_string_reader=>create( lv_xstring ).
*
*    lv_node = lv_reader->read_next_node( ).
*
*
*    ASSERT lv_node IS NOT INITIAL.
*    WHILE lv_reader->node_type <> if_sxml_node=>co_nt_final.
*      CASE lv_reader->node_type.
*        WHEN if_sxml_node=>co_nt_element_open.
*          lv_open_node  ?= lv_node.
*
*          gv_field = 'ls_data-' && lv_open_node->qname-name.
*
*        WHEN if_sxml_node=>co_nt_element_close.
*          lv_close_node ?= lv_node.
*
*          IF lv_close_node->qname-name = gv_cond.
*            APPEND ls_data TO lt_data.
*            CLEAR ls_data.
*          ELSE.
*            ASSIGN (gv_field) TO <fs>.
*            IF sy-subrc = 0.
*              <fs> = lv_value.
*            ENDIF.
*          ENDIF.
*
*        WHEN if_sxml_node=>co_nt_value.
*          lv_value_node ?= lv_node.
*          lv_value = lv_value_node->get_value( ).
*        WHEN if_sxml_node=>co_nt_attribute.
*      ENDCASE.
*      lv_node = lv_reader->read_next_node( ).
*    ENDWHILE.
*
*    MOVE-CORRESPONDING lt_data TO out_tab .
*
*
*
*  ENDMETHOD.
*
*  METHOD create_api.
*  ENDMETHOD.

  METHOD create_api.

  ENDMETHOD.

ENDCLASS.

CLASS lsc_ymoon_i_api012 DEFINITION INHERITING FROM cl_abap_behavior_saver.
  PROTECTED SECTION.

    METHODS finalize REDEFINITION.

    METHODS check_before_save REDEFINITION.

    METHODS save REDEFINITION.

    METHODS cleanup REDEFINITION.

    METHODS cleanup_finalize REDEFINITION.

ENDCLASS.

CLASS lsc_ymoon_i_api012 IMPLEMENTATION.

  METHOD finalize.
  ENDMETHOD.

  METHOD check_before_save.
  ENDMETHOD.

  METHOD save.
  ENDMETHOD.

  METHOD cleanup.
  ENDMETHOD.

  METHOD cleanup_finalize.
  ENDMETHOD.

ENDCLASS.
